<script lang="ts" setup>
import { useLocale } from '@/locale/locale';

const props = defineProps<{
  text: string;
}>();

const { t } = useLocale();

function handleCopy() {
  uni.setClipboardData({
    data: props.text,
    success() {
      uni.showToast({
        title: t('LCKey_copied')
      });
    }
  });
}
</script>

<template>
  <view class="text-sm text-blue" @click="handleCopy">
    {{ t('LRKey_copy') }}
  </view>
</template>
